home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of Down Under Games
/
The Best of Down Under Games.iso
/
3dfx Screen Savers
/
Impact
/
IMPSRC.ZIP
/
LAND.H
< prev
next >
Wrap
C/C++ Source or Header
|
1997-07-22
|
2KB
|
65 lines
#ifndef _LAND_H_
#define _LAND_H_
#include <glide.h>
#include "math3d.h"
//#include "things.h"
int NumLand;
const int vertsep = 192;
const int tdx = 4,tdz = tdx;
const int gridsep = vertsep*(tdx);
const int GridNum = 32;
const int vertscnt = (tdx+1)*(tdz+1);
const int sqrcnt = tdx*tdz;
const int GridNum2 = GridNum*GridNum;
const int LevMax = GridNum*gridsep+vertsep;
const int width = (tdx)*GridNum+1,width2=width*width;
const int specwidth = 256;
const int VertWidth = GridNum*(tdx-1)+1;
const int VertWidth2 = VertWidth*VertWidth;
const int Bigsqrcnt = sqrcnt*GridNum2;
typedef struct light_t{
float r,g,b,a;
};
class entity_t;
BOOL MyDrawTriangleTooClose(GrVertex bad1, GrVertex bad2,GrVertex bad3,
GrVertex old1, GrVertex old2,GrVertex old3,
Matrix rot,float x, float y, float z);
typedef struct landrect_t{
int corn[4];
float s[4];
float t[4];
int texture;
char r[4],g[4],b[4],a[4];
int CentX,CentZ;
};
GrVertex Start[width*width],Trans[width*width];
landrect_t Rects[GridNum2*tdx*tdz],*Water;
light_t lit[width*width];
void Genland(void);
class land_t{
private:
int MyRects[sqrcnt],*WaterRects;
int numland,numwater;
float centerx,centerz;
int id;
float pntx[5];
float pnty[5];
float pntz[5];
public:
float minx,maxx,minz,maxz;//bounding area.
int MyVerts[vertscnt];
int rendered;
land_t();
land_t(float x, float z, int mid);
~land_t();
//int test(Matrix rot,float x, float y, float z);
int render(Matrix rot,float x, float y, float z);
void castlight(entity_t *Other);
int generate(float x, float z, int mid);
};
land_t *land;
#endif